package com.ruoyi.follow_live.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.follow_live.mapper.FollowLiveRoomMapper;
import com.ruoyi.follow_live.domain.FollowLiveRoom;
import com.ruoyi.follow_live.service.IFollowLiveRoomService;
import com.ruoyi.common.core.text.Convert;

/**
 * 关注直播间Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-04-08
 */
@Service
public class FollowLiveRoomServiceImpl implements IFollowLiveRoomService 
{
    @Autowired
    private FollowLiveRoomMapper followLiveRoomMapper;

    /**
     * 查询关注直播间
     * 
     * @param id 关注直播间主键
     * @return 关注直播间
     */
    @Override
    public FollowLiveRoom selectFollowLiveRoomById(Integer id)
    {
        return followLiveRoomMapper.selectFollowLiveRoomById(id);
    }

    /**
     * 查询关注直播间列表
     * 
     * @param followLiveRoom 关注直播间
     * @return 关注直播间
     */
    @Override
    public List<FollowLiveRoom> selectFollowLiveRoomList(FollowLiveRoom followLiveRoom)
    {
        return followLiveRoomMapper.selectFollowLiveRoomList(followLiveRoom);
    }

    /**
     * 新增关注直播间
     * 
     * @param followLiveRoom 关注直播间
     * @return 结果
     */
    @Override
    public int insertFollowLiveRoom(FollowLiveRoom followLiveRoom)
    {
        followLiveRoom.setCreateTime(DateUtils.getNowDate());
        return followLiveRoomMapper.insertFollowLiveRoom(followLiveRoom);
    }

    /**
     * 修改关注直播间
     * 
     * @param followLiveRoom 关注直播间
     * @return 结果
     */
    @Override
    public int updateFollowLiveRoom(FollowLiveRoom followLiveRoom)
    {
        return followLiveRoomMapper.updateFollowLiveRoom(followLiveRoom);
    }

    /**
     * 批量删除关注直播间
     * 
     * @param ids 需要删除的关注直播间主键
     * @return 结果
     */
    @Override
    public int deleteFollowLiveRoomByIds(String ids)
    {
        return followLiveRoomMapper.deleteFollowLiveRoomByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除关注直播间信息
     * 
     * @param id 关注直播间主键
     * @return 结果
     */
    @Override
    public int deleteFollowLiveRoomById(Integer id)
    {
        return followLiveRoomMapper.deleteFollowLiveRoomById(id);
    }
}
